;;;Format supplied radian angle in Northing and Easting format.
;;;Degree symbol is specified using (char 176) OR %%221 (custom font character) depending on the font.
;;;Also, pads zeros in minutes and seconds for 2 digit zero to 9 readings.
;;;
;;;	Author:
;;;		Henry C. Francis
;;;		425 N. Ashe St.
;;;		Southern Pines, NC 28387
;;;
;;;	http://www.paracadd.com
;;;	All rights reserved.
;;;
(defun survang ( radang / )
    (cond
      ((eq radang 0)
        (setq radang (/ pi 2) angpref "N " angsuf " E"))
      ((eq radang (/ pi 2))
        (setq radang 0 angpref "N " angsuf " W"))
      ((eq radang pi)
        (setq radang (/ pi 2) angpref "N " angsuf " W"))
      ((eq radang (* pi 1.5))
        (setq radang 0 angpref "S " angsuf " W"))
      ((and(< radang (/ pi 2))(> radang 0))
        (setq radang (-(/ pi 2) radang) angpref "N " angsuf " E"))
      ((and(< radang pi)(> radang (/ pi 2)))
        (setq radang (-(/ pi 2)(- pi radang)) angpref "N " angsuf " W"))
      ((and(< radang (* pi 1.5))(> radang pi))
        (setq radang (-(* pi 1.5) radang) angpref "S " angsuf " W"))
      ((and(< radang (* pi 2))(> radang (* pi 1.5)))
        (setq radang (-(/ pi 2)(-(* pi 2) radang)) angpref "S " angsuf " E"))
    )
    (setq anglt (ANGTOS radang 1 4))
    (SETQ count (STRLEN anglt) atxt anglt) 
    (WHILE (AND (NOT (= (SUBSTR atxt 1 1) "d")) (> count 0)) ;and
      (SETQ atxt (SUBSTR atxt 2) count (1- count))
    )					;while
    (IF (= (SUBSTR atxt 4 1) "'")
	(SETQ angmin (SUBSTR atxt 2 3) secinx 5)
	(SETQ angmin (STRCAT "0" (SUBSTR atxt 2 2)) secinx 4)
    )					;if
    (IF (= (SUBSTR atxt (1+ secinx) 1) "\"")
	(SETQ angsec (STRCAT "0" (SUBSTR atxt secinx 2)))
	(SETQ angsec (SUBSTR atxt secinx 3))
    )					;if
    (SETQ
      anglt (STRCAT angpref (SUBSTR anglt 1 (- (STRLEN anglt) (STRLEN atxt)))
		    (IF (WCMATCH(CDR(ASSOC 3(TBLSEARCH "STYLE"(GETVAR "textstyle"))))"cdm*.shx")
		      "%%221"
		      (CHR 176)
		    )
		    angmin
		    angsec
                    angsuf
	    ) ;_ end of strcat
    ) ;_ end of setq 
)